#include "filewidget.h"
#include "ui_filewidget.h"

fileWidget::fileWidget(QWidget *parent) :
    QDialog(parent),
    ui(new Ui::fileWidget)
{
    ui->setupUi(this);
    mydir = new QDir(QDir::currentPath());
    mydir->cd("midi");
    mydir->setFilter(QDir::Files);
    QFileInfoList list= mydir->entryInfoList();

    for(int i=0;i<list.size();i++)
    {
        QFileInfo fileinfo =list.at(i);
        ui->listWidget->addItem(fileinfo.fileName());

    }
}

fileWidget::~fileWidget()
{
    delete ui;
}
QString fileWidget::getMidiPath()
{
    return mydir->filePath(ui->listWidget->currentItem()->text());
}
QString fileWidget::getMidiName()
{

    return ui->listWidget->currentItem()->text();
}
